﻿/// <reference path="../lib/require.js" />
/// <reference path="../lib/knockout-2.3.0.js" />
define(['lib/knockout-2.3.0', 'utility/navigator'], function (ko, navigator) {
    var currentURL = window.location.href,
        defaultURL = 'welcome.html',
        _content = ko.observable(undefined),
        menuClickCallback = function (nav) {
            _content(nav.view);
            var mainContent = document.querySelector('.mainContent');
            ko.applyBindings(nav.viewmodel, mainContent);
        };
        navigator.navigate(defaultURL, menuClickCallback);
    return {
        menu: navigator.menu,
        content: _content,
        onMenuClick: function (menu) {
            navigator.navigate(menu.Link, menuClickCallback);
        }
    };
});